<script>
    import Vue from 'vue'
    import floatBall from './components/floatBall'
    Vue.use(floatBall)
	export default {
        onLaunch: function(e) {
            if(e.shareUserId) {
                uni.setStorageSync( 'shareUserId', e.shareUserId)
            }
            console.log(e, 'App Launch')
            if(location.pathname != '/pages/map/index') {
                setTimeout(this.$floatBall.init, 1000);
            }
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		// #ifdef H5
        watch: {
            $route: {
                immediate: true,
                deep:true,
                handler() {
                    setTimeout(() => {
                        let title = document.getElementsByClassName('uni-page-head__title').innerHTML
                        if(title) {
                            document.title = title
                        }
                    })
                }
            }
        },
        // #endif
		methods: {

        }
	}
</script>

<style lang="less">
    @import "~@/styles/default.less";
	/*每个页面公共css */
    uni-page-head{
        display: none;
    }
</style>
